import {baseRequest} from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/security/group/` + url, ...arg)

export default {
	async fetchGroupPage(query) {
		return await request('page', query, 'get')
	},
	async fetchGroupList() {
		return await request('list', null, 'get')
	},
	async fetchGroupDetail(query) {
		return await request('detail', query, 'get')
	},
	async createGroup(data) {
		return await request('create', data, 'post')
	},
	async updateGroup(query) {
		return await request('update', query, 'post')
	},
	async deleteGroup(data) {
		return await request('delete', data, 'post')
	},
	async updateGroupEnableStatus(id, enable) {
		return await request('update/enable-status', {
			id: id,
			enable: enable
		}, 'post')
	}
}
